<?php

namespace app\agent\validate;

use think\Validate;

class Refund extends Validate
{
    protected $rule = [
        'amount' => 'require',
        'alipay' => 'require|max:50',
        'mobile' => 'require',
        'wechat' => 'require|max:40',

        'bank_card_no' => 'require|max:30',
        'bank_username' => 'require|max:20',
        'bank_name' => 'require|max:50',
        'user_remark' => 'max:100',
    ];

    protected $message = [
        'amount.require' => '请填写退款金额',
        'alipay.require' => '请填写支付宝账号',
        'alilpay.max' => '支付宝账号长度不能大于 50 个字符',
        'mobile.require' => '请填写手机号码',
        'wechat.require' => '请填写微信号',
        'wechat.max' => '微信号长度不能超过 40 个字符',

        'bank_card_no.require' => '请填写银行卡号',
        'bank_card_no.max' => '银行卡号不能大于 30 个字符',
        'bank_username.require' => '请填写银行卡户名',
        'bank_username.max' => '银行卡户名不能超过 20 个字符',
        'bank_name.require' => '请填写开户行',
        'bank_name.max' => '开户行不能超过 50 个字符',
        'user_remark.max' => '备注不能超过 100 个字符',
    ];

    protected $scene = [
        'alipay' => [
            'amount',
            'alipay',
            'mobile',
            'wechat',
        ],
        'bank' => [
            'amount',
            'bank_card_no',
            'bank_username',
            'bank_name',
            'mobile',
            'user_remark',
        ],
    ];
}
